package com.moyq5.mvc.maker.test.bean.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * 套餐配置
 * @author Moyq5
 * @date 2018年4月13日
 */
@Entity
@Table(name = "uc_meal")
@DynamicUpdate
public class Meal implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1611868640403609839L;
	/**
	 * 套餐ID
	 */
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "native")@GenericGenerator(name = "native", strategy = "native")
    @Column(name = "meal_id")
	private Long mealId;
	/**
	 * 商家
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "merch_id", nullable = false)
	private Merch merch;
	/**
	 * 套餐名称
	 */
    @Column(name = "name", length = 100, nullable = false)
	private String name;
    /**
	 * 金额
	 */
	@Column(name = "amount", precision = 10, scale = 2, nullable = false)
	private BigDecimal amount;
	/**
	 * 积分,即花多少金额可以购买多少积分
	 */
	@Column(name = "quantity", precision = 10, scale = 0, nullable = false)
	private Integer quantity;
	/**
	 * 使用说明
	 */
	@Column(name = "spec", length = 600)
	private String spec;
	public Long getMealId() {
		return mealId;
	}
	public void setMealId(Long mealId) {
		this.mealId = mealId;
	}
	public Merch getMerch() {
		return merch;
	}
	public void setMerch(Merch merch) {
		this.merch = merch;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public Integer getQuantity() {
		return quantity;
	}
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}
	public String getSpec() {
		return spec;
	}
	public void setSpec(String spec) {
		this.spec = spec;
	}
	
}
